﻿using MediatR;
using Swork03_28.Api.Application.Commands.TraceableCommand;
using Swork03_28.Domain.TraceableInfos;
using Swork03_28.Services.Interface;

namespace Swork03_28.Api.Application.CommandHandlers.TraceableHandler
{
    public class TraceableBackfillCommandHandler : IRequestHandler<TraceableBackfillCommand, Traceables>
    {
        private readonly ITraceableService traceableService;

        public TraceableBackfillCommandHandler(ITraceableService traceableService)
        {
            this.traceableService = traceableService;
        }

        public async Task<Traceables> Handle(TraceableBackfillCommand request, CancellationToken cancellationToken)
        {
            return await traceableService.GetAsync(request.Id);
        }
    }
}
